package com.wch.SpringBootTestDemo.activemq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

@Component
public class JMSConsumerTwo {

	private Logger logger = LoggerFactory.getLogger(JMSConsumerTwo.class);
	
	/**
	 * 使用JmsListener配置消费者监听的队列
	 * @param message  接收到的消息
	 * @return
	 */
	@JmsListener(destination="message_queue")
	@SendTo("out_queue")
	public String receiveQueue(String message){
		logger.info("JMSConsumerTwo收到的报文为--"+message);
		logger.info("JMSConsumerTwo收到报文后：返回数据到out_queue");
		return message;		
	}
}
